package com.panshi.modules.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 857
 * @since 2020-07-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SysUser对象", description="")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

        @ApiModelProperty(value = "系统用户ID")
        @TableId(value = "id", type = IdType.AUTO)
        private Integer id;

        @ApiModelProperty(value = "登录账号")
        private String username;

        @ApiModelProperty(value = "密码")
        private String password;

        @ApiModelProperty(value = "真实姓名")
        private String realname;

        @ApiModelProperty(value = "性别")
        private String gender;

        @ApiModelProperty(value = "手机号")
        private String phone;

        @ApiModelProperty(value = "邮箱")
        private String email;

        @ApiModelProperty(value = "工号")
        private String jobNumber;

        @ApiModelProperty(value = "简介")
        private String introduce;

        @ApiModelProperty(value = "头像图地址")
        private String photoPath;

        @ApiModelProperty(value = "创建时间")
        @TableField(fill = FieldFill.INSERT)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date createTime;

        @ApiModelProperty(value = "最后登录时间")
        @TableField(fill = FieldFill.INSERT)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date lastLoginTime;

        @ApiModelProperty(value = "状态:0-禁止,1-启用")
        private Integer status;


        @ApiModelProperty(value = "用户所有的角色")
        @TableField(exist = false)
        private List<SysRole> sysRoles;

        @ApiModelProperty(value = "用户所有的权限菜单")
        @TableField(exist = false)
        private List<SysMenu> sysMenus;


}
